package mya.mes.mdc.model.status;

import mya.mes.mdc.model.plc.PlcTagDef;
import mya.mes.mdc.model.plc.PlcTagType;
import org.eclipse.persistence.annotations.Cache;

import javax.persistence.*;

/**
 * prefix: AI = 1, DI = 2, ST = 3 <br>
 * objectId = prefix+  tagIndex（4位）  + bitIndex（2位）
 */
@Entity
@Cacheable
@Cache(size = 2000)
@Table(name = "MDC_STATUS_TYPE", indexes = {
        @Index(name = "TAG_IDNEX", columnList = "MDC_TAG ASC"),
        @Index(name = "TAG_BIT_IDNEX", columnList = "MDC_TAG ASC,BIT_INDEX ASC"),
})
public class MdcStatusType extends PlcTagDef {
    @Transient
    private final PlcTagType plcTagType = PlcTagType.STATUS;

    @Transient
    @Override
    public PlcTagType getPlcTagType() {
        return plcTagType;
    }
}
